<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/default.xhtml">
	<ui:define name="header">
		<h1>Confirmed Signup Requests</h1>
	</ui:define>
	<ui:define name="content">

		<h:panelGroup rendered="#{empty confirmedRequests}">
			<em>No confirmed requests.</em>
		</h:panelGroup>
		<ui:fragment rendered="#{not empty confirmedRequests}">
			<table class="table">
				<tr>
					<th>Name</th>
					<th>Email</th>
					<th>Company Name</th>
					<th width="150px">Created On</th>
					<th width="150px">Action</th>
				</tr>
				<ui:repeat id="dataTable" var="obj" value="#{confirmedRequests}">
					<tr>
						<td><h:link id="viewLink" outcome="/admin/requestDetail">
								<f:param name="id" value="#{obj.id}" />
							#{obj.name}</h:link></td>
						<td><a href="mailto:#{obj.email}">#{obj.email}</a></td>
						<td>#{obj.companyName}</td>
						<td widtd="150px"><h:outputText value="#{obj.createdOn}">
								<f:convertDateTime dateStyle="medium" />
							</h:outputText></td>
						<td widtd="150px">#{' '} <ui:fragment
							rendered="#{facesContext.externalContext.isUserInRole('ROLE_ADMINISTRATOR')}">
							<h:commandButton id="approveButton" action="#{requestHome.approve(obj.id)}"
								value="Approve" styleClass="btn btn-primary" />#{' '}
							<h:link id="confirmDenialLink" outcome="/admin/confirmDenial.xhtml" styleClass="btn btn-small"
								value="Deny">
								<f:param name="id" value="#{obj.id}" />
							</h:link>
						</ui:fragment></td>
					</tr>
				</ui:repeat>
			</table>
		</ui:fragment>
		
	</ui:define>
</ui:composition>
